package com.by.config;

import com.by.entity.Minio;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 江俊俊
 * @version 1.0
 * @description
 * @date 2025/4/11 11:26
 * @since JDK1.8
 */
@Configuration
public class MinioConfig {

    @Autowired
    private Minio minio;

    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder()
                .endpoint(minio.getUrl())
                .credentials(minio.getUsername(), minio.getPassword())
                .build();
    }
}
